Перейти к основному содержимому

Create Reseller API

POST /createReseller

Description

This API endpoint allows an admin to create a new reseller by providing essential details such as email, password, credit, level, and phone number. Resellers are users with specific roles and permissions to manage and distribute services.

Request Body

The request utilizes GraphQL to perform the createReseller mutation.

Mutation:

mutation createReseller ($reseller: ResellerCreate) {
createReseller (reseller: $reseller) {
id
email
firstName
lastName
credit
level
phone
}
}

Variables:

{
"reseller": {
"email": "<Reseller_Email>",
"password": "<Reseller_Password>",
"credit": "<Credit_Amount>",
"level": "<Reseller_Level>",
"phone": "<Phone_Number>"
}
}
  • reseller (ResellerCreate Object): An object containing the reseller's account details.
    • email (String): The email address of the reseller.
    • password (String): The password for the reseller's account.
    • credit (String): The amount of credit assigned to the reseller.
    • level (String): The level or tier of the reseller within the platform.
    • phone (String): The phone number of the reseller.

Response:

  • Success (200 OK):

    • If the reseller creation is successful, the response will return the newly created reseller's details, including their ID, email, and other attributes.
    {
    "data": {
    "createReseller": {
    "id": "<Reseller_ID>",
    "email": "<Reseller_Email>",
    "firstName": "<First_Name>",
    "lastName": "<Last_Name>",
    "credit": "<Credit_Amount>",
    "level": "<Reseller_Level>",
    "phone": "<Phone_Number>"
    }
    }
    }
  • Error (4XX/5XX):

    • Appropriate error messages and status codes will be returned in cases of invalid data, missing required fields, or server errors.

Note:

Ensure that all required fields for the reseller object are provided and correctly formatted according to the platform's specifications. This API should be used by admins with the necessary permissions to create and manage reseller accounts.